<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
<script src="${pageContext.request.contextPath}/js/jquery-1.7.2.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>

<title>Insert title here</title>
</head>
<script type="text/javascript">
$(function(){
	//修改
	$("#updateBtn").click(function(){
		var ched=$(":checkbox:checked");
		if(ched.size()>1||ched.size()==0){
			alert("无法修改");
		}else{
			$("#showUpdate").show();
			var sellerid=$(":checkbox:checked").next().text();
			var sellername=$(":checkbox:checked").parent().next().next().text();
			var shopname=$(":checkbox:checked").parent().next().next().next().text();
			var sellerphone=$(":checkbox:checked").parent().next().next().next().next().text();
			var selleraddr=$(":checkbox:checked").parent().next().next().next().next().next().text();
			var sellerpsw=$(":checkbox:checked").parent().next().next().next().next().next().next().text();
			var sellergenre=$(":checkbox:checked").parent().next().next().next().next().next().next().next().text();
		$("#ssellerid").val(sellerid);
		$("#ssellername").val(sellername);
		$("#sshopname").val(shopname);
		$("#ssellerphone").val(sellerphone);
		$("#sselleraddr").val(selleraddr);
		$("#ssellerpsw").val(sellerpsw);
		$("#ssellergenre").val(sellergenre);
		}
		
	});

})
</script>
<body>
<button id="updateBtn"  type="button" class="btn btn-primary">修改商家信息</button>     
     
			<div>
			<table class="table table-bordered" >
				<tr>
					<td class="active">勾选框</td>
					<td class="success">商家ID</td>
					<td class="warning">商家老板名称</td>
					<td class="danger">店铺名称</td>
					<td class="info">商家电话</td>
					<td class="active">商家地址</td>
					<td class="warning">商家帐号密码</td>
					<td class="danger">商家菜品情况</td>
				</tr>
				

					<tr>
					<td><input type="checkbox" name="checkbox"></td>
						<td>${currentSeller.sellerid}</td>
						<td>${currentSeller.sellername}</td>
						<td>${currentSeller.shopname}</td>
						<td>${currentSeller. sellerphone}</td>
						<td>${currentSeller.selleraddr }</td>
						<td>${currentSeller.sellerpsw }</td>
						<td>${currentSeller.shopgenre }</td>

					</tr>
			
			</table>



		
	</div>
	
		<!-- 修改  -->
		
	<div style="display: none" id="showUpdate">
	
		<form action="${pageContext.request.contextPath}/updateSeller" method="post">
		          商家老板ID:<input type="text" name="sellerid" id="ssllerid" style="display: none"/> </br>
			商家老板名称:<input type="text" name="sellername" id="ssellername" /> </br>
     		店铺名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="shopname" id= "sshopname"/> </br>
			商家电话&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="sellerphone" id="ssellerphone"/></br>
			商家地址&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   <input type="text" name="selleraddr" id="sselleraddr"/></br>
			商家帐号密码<input type="text" name="sellerpsw" id="ssellerpsw"/></br>
			商家菜品情况<input type="text" name="sellergenre" id="ssellergenre"/>	</br>
			<input type="submit" value="提交">
			<br>
		</form>
	</div>
</body>
</html>